package com.kasax.plugin.app.transform

import com.kasax.plugin.app.transform.base.BaseCustomTransform
import java.io.InputStream
import java.io.OutputStream

/**
 * https://mp.weixin.qq.com/s/JqJuKwrbriJ-4Hn14KMS4A
 */
class MyCustomTransform2 : BaseCustomTransform(true) {

    /**
     * 此方法可以使用 ASM 或 Javassist 进行字节码插桩
     * 目前只是一个默认实现
     */
    override fun provideFunction(): ((InputStream, OutputStream) -> Unit)? = { ios: InputStream, zos: OutputStream ->
        zos.write(ios.readAllBytes())
    }

    override fun getName(): String? = "MyCustomTransform2"

}